package pailaidai.hc.com.mysvgdemo.view;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by Administrator on 2018/4/12.
 */

public class MyViewGroup extends ViewGroup {


    public MyViewGroup(Context context) {
        super(context);
    }

    public MyViewGroup(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyViewGroup(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    /**
     * 确定每个子组件的位置
     * b 是否有新的尺寸或位置
     * i left
     * t top
     * r right
     * b bottom
     */
    @Override
    protected void onLayout(boolean b, int i, int i1, int i2, int i3) {

    }

    /**
     * 测量容器的尺寸
     * widthMeasureSpec 宽度模式与大小
     * heightMeasureSpec 高度模式与大小
     */
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        this.measureChildren(widthMeasureSpec, heightMeasureSpec);//先测量所有的子组件的大小
    }

    /**
     * 绘制容器
     */
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
    }

    protected void measureChildren(int widthMeasureSpec,int heightMeasureSpec){
        final int size=getChildCount();


    }



}
